#include "Object.h"
#include "Sprite.h"
#include "Box.h"
#define BOUND 5
Object::Object(Box* box, ObjectType obj)
{
	_box = box;
	_obj = obj;
	this->_sprite = NULL;
	_boundBox = new Box(D3DXVECTOR2(),D3DXVECTOR2(),D3DXVECTOR2(0,0));
	_colBox = new Box();
}

Object::Object(Box* box)
{
	_box = box;	
	this->_sprite = NULL;	
	_isAlive = true;
	_colBox = new Box();
}

Object::~Object(void)
{
}

void Object::init()
{
	
}

void Object::update()
{

}

void Object::render()
{

}

Box* Object::getBox()
{
	return _box;
}

ObjectType Object::getObjectType()
{
	return _obj;
}

void Object::collide()
{
	_hits--;
}

void Object::collide(int damage)
{
	_hits -= damage;
}

bool Object::isAlive()
{
	return _isAlive;
}

Box* Object::getBoundBox()
{
	_boundBox->_position = _box->_position;
	_boundBox->_size = _box->_size;
	_boundBox->_position.x -= BOUND;
	_boundBox->_position.y -= BOUND;
	_boundBox->_size.x += 2 * BOUND;
	_boundBox->_size.y += 2 * BOUND;
	return _boundBox;
}
